﻿using System.Web.Mvc;
using System.Web.Routing;

namespace tophd2.Classes
{
    public class AppRouteMap
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("{*staticfile}", new { staticfile = @".*\.(css|js|gif|jpg|png)(/.*)?" });
            routes.IgnoreRoute("{*allaspx}", new { allaspx = @".*\.sauth(/.*)?" });


            routes.MapRoute("StoryInfo", "Story/StoryList/{productCode}/{page}",
                new { controller = "Story", action = "StoryList", productCode = "0", page = "1" }
                );

            //Product Details
            routes.MapRoute("ActivateAccount", "Account/ActivateAccount/{ActivationKey}",
                new { controller = "Account", action = "ActivateAccount", ActivationKey = "" }
                );
            //Product Details
            routes.MapRoute("ActivateAccountBookMate", "Account/ActivateAccount/{ActivationKey}/{BookMateProfileID}",
                new { controller = "Account", action = "ActivateAccount", ActivationKey = "", BookMateProfileID = 0 }
                );
            routes.MapRoute("DisconnectBSVDevice", "Account/DisconnectBSVDevice/{DeviceAccessId}",
                new { controller = "Account", action = "DisconnectBSVDevice", DeviceAccessId = "0" }
                );
            ////Campaign User
            //routes.MapRoute("Campaign", "Account/Campaign/{key}",
            //    new { controller = "Account", action = "Campaign" }
            //    );

            //Free Credits
            routes.MapRoute("FreeCredits", "Home/FreeCredits",
                new { controller = "Home", action = "FreeCredits" }
                );

            routes.MapRoute(
                 "Default2",                                              // Route name
                 "{controller}/{action}/{id}",                           // URL with parameters
                 new { controller = "Home", action = "Index", id = UrlParameter.Optional }  // Parameter defaults
             );

            //ProductByCategory
            routes.MapRoute("ImageByCategory", "Category/ImageByCategory/{categoryId}",
                 new { controller = "Category", action = "ImageByCategory", categoryId = "0" }
                 );
            routes.MapRoute("VideoByCategory", "Category/VideoByCategory/{categoryId}",
                 new { controller = "Category", action = "VideoByCategory", categoryId = "0" }
                 );
            routes.MapRoute("NewsByCategory", "Category/NewsByCategory/{categoryId}",
                 new { controller = "Category", action = "NewsByCategory", categoryId = "0" }
                 );
        }
    }
}